package com.uobgroup.ews.uam.core.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.uobgroup.ews.uam.core.domain.AccessToStaff;

@Repository
public class AccessToStaffDaoImpl extends AbstractJpaDao<AccessToStaff> implements AccessToStaffDao {
   
   public AccessToStaffDaoImpl() {
      setClazz(AccessToStaff.class);
   }
   
   @Override
   public long count() {
      return entityManager.createQuery("SELECT COUNT(o) FROM AccessToStaff o", Long.class).getSingleResult();
   }

   @Override
   public List<AccessToStaff> findAll(int firstResult, int maxResults) {
      return entityManager.createQuery("SELECT o FROM AccessToStaff o", AccessToStaff.class).setFirstResult(firstResult)
            .setMaxResults(maxResults).getResultList();
   }

}
